package cn.com.cifi.mars.service;

import cn.com.cifi.mars.bean.bo.returnPlan.CombinationProductDataBO;
import cn.com.cifi.mars.bean.param.returnPlan.ReturnPlanApprovalSubmitParam;
import cn.com.cifi.mars.bean.param.returnPlan.ReturnPlanCreateParam;
import cn.com.cifi.mars.bean.param.returnPlan.ReturnPlanDetailSaveParam;
import cn.com.cifi.mars.bean.vo.returnPlan.*;
import cn.com.cifi.mars.entity.PortalTodo;
import cn.com.cifi.mars.entity.ReturnPlanVersion;
import cn.com.cifi.mars.entity.ReturnPlanVersionDetail;
import cn.com.cifi.mars.entity.common.IdmUser;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 回款计划版本表 服务类
 * </p>
 *
 * @author JingYuanXiang
 * @since 2020-11-06
 */
public interface ReturnPlanVersionService extends IService<ReturnPlanVersion> {

    //获取新建来源数据
    ReturnCreateSourceDataVo getCreateSourceData(String stageId, String versionType);
    //新建回款计划
    void create(ReturnPlanCreateParam param,IdmUser user);
    //异常新建回款计划
    void exceptionCreate(ReturnPlanCreateParam param, IdmUser user);
    //查询分期最新版本类型
    String getNewVersionType(String stageId);
    //获取回款计划数据列表
    List<ReturnPlanVersionDataVo> getReturnPlanVersionDataList(String stageId, String versionType);
    //查看回款计划年份列表
    List<String> getYearList(String versionId);
    //获取回款计划一年数据
    List<ReturnPlanYearDataVo> getAnnualData(String versionId, String year);
    //查询回款计划编辑页面数据
    ReturnPlanEditDataVo getEditDataList(String versionId, String groupId);
    //删除回款计划
    void delById(String versionId, IdmUser user);
    //更新版本状态
    void updateState(List<String> versionIds, String versionEvent,String versionState, IdmUser user);
    //回款计划编辑页面保存
    void editSave(List<ReturnPlanDetailSaveParam> paramList, IdmUser user);
    //获取回款计划编辑页面组团列表
    List<ReturnPlanGroupVo> getGroupList(String versionId);
    //获取回款计划回款系数
    List<ReturnPlanReturnCoefficientDetailVo> getReturnCoefficientDetailList(String versionId);
    //发送回款代办
    void returnNoticeDispose(String signId);
    //查询回款计划待办
    PortalTodo getPortalTodo(String combinationId);
    //消除回款代办
    String deleteTodoInfo(String versionId, String operatorType, IdmUser handUser);
    //回款计划全盘概览
    List<ReturnPlanOverviewDataVo> fullOverview(String versionId, String year, String month);
    //查询回款计划审批预览数据
    ReturnPlanApprovalPreviewVo getApprovalPreview(String projectId, String approvalId);
    //审批提交
    String approvalSubmit(ReturnPlanApprovalSubmitParam param, IdmUser user);
    //查看全盘回款计划年份列表
    List<String> overallYearList(String projectId);
    //查看全盘回款计划一年数据
    List<ReturnPlanYearDataVo> overallAnnualData(String projectId, String year);
    //审批校验
    void approvedCheck(String projectId);
    //设置考核版本
    void setAssessment(String versionId);
    
    void copyToBudgetVersion(String versionId, String versionIdentify,IdmUser user);
    
    void copyBudgetVersion(String versionId,String versionIdentify, IdmUser user);

    /**-------------------------公用方法----------------------**/
    //获取组合业态数据数据
    CombinationProductDataBO getCombinationProductData(String signPlanVersionId);
    //回款详情数据补充
    ReturnPlanVersionDetail getEarlyMonthDataSupplement(List<ReturnPlanVersionDetail> returnPlanDetailList, int year);
    ReturnPlanVersionDetail getFinalMonthDataSupplement(List<ReturnPlanVersionDetail> returnPlanDetailList, int year);
    //获取签约与回款
    SignAndReturnVo getSignAndReturn(BigDecimal totalValue, LocalDateTime affiliationTime, List<ReturnPlanVersionDetail> returnPlanDetailList);
    //获取年度数据
    ReturnPlanDetailYearData getYearData(int year, LocalDateTime affiliationTime, List<ReturnPlanVersionDetail> returnPlanDetailList, ReturnPlanVersionDetail earlyMonthData, ReturnPlanVersionDetail finalMonthData);
    //获取月度数据
    List<ReturnPlanDetailMonthData> getMonthDataList(int year, LocalDateTime affiliationTime, List<ReturnPlanVersionDetail> returnPlanDetailList, ReturnPlanVersionDetail earlyMonthData, ReturnPlanVersionDetail finalMonthData);
    //获取全盘版本id列表
    List<String> getOverallVersionIdList(String projectId);
    //获取项目全盘版本列表
    List<ReturnPlanVersion> getProjectOverallVersionList(String projectId);
    //获取全盘版本列表
    List<ReturnPlanVersion> getOverallVersionList(String yearMonth);
    //获取版本号
    String getVersionNum(String stageId, String versionType, String versionIdentify, String affiliationMonth);
}
